home *** CD-ROM | disk | FTP | other *** search
- global statusChk, progressSprite, netID, progWide, badgeLine, gSM_StretchContent, puzzleDay, stageWide, stageTall, puzzlePicID, puzzleTxtID
-
- on prepareMovie
- clearGlobals()
- put the movieAboutInfo & RETURN into field "version"
- put the movieCopyrightInfo after field "version"
- gSM_StretchContent = 0
- resizeStage()
- the idleHandlerPeriod = 0
- set the exitLock to 1
- set the rect of sprite 1 to rect(0, 21, stageWide, stageTall)
- set the rect of sprite 40 to rect(0, 21, stageWide, stageTall)
- netID = tellStreamStatus(1)
- progWide = 259
- progressSprite = 241
- statusChk = 0
- badgeLine = 0
- set the stretch of sprite (progressSprite + 1) to 1
- set the width of sprite (progressSprite + 1) to 1
- member("puzzPicFile").editable = 0
- put "Download progress" into member "puzzPicFile"
- updateStage()
- end
-
- on streamStatus url, state, bytesSoFar, bytesTotal, error
- member("puzzPicFile").editable = 0
- if netID > 0 then
- set the height of sprite (progressSprite + 1) to 10
- if statusChk = 0 then
- startTimer()
- end if
- statusChk = statusChk + 1
- case 1 of
- (statusChk = 1):
- currentPercent = bytesSoFar / float(bytesTotal)
- put "Downloaded" && integer(currentPercent * 100) & "% -" && bytesSoFar / 1000 & "K of" && bytesTotal / 1000 & "K" into member "puzzPicFile"
- if the width of sprite (progressSprite + 1) < (progWide * currentPercent) then
- set the width of sprite (progressSprite + 1) to progWide * currentPercent
- updateStage()
- end if
- startTimer()
- ((statusChk < 5) and (statusChk > 1)):
- currentPercent = bytesSoFar / float(bytesTotal)
- put "Downloaded" && integer(currentPercent * 100) & "% -" && bytesSoFar / 1000 & "K of" && bytesTotal / 1000 & "K" into member "puzzPicFile"
- if the width of sprite (progressSprite + 1) < (progWide * currentPercent) then
- set the width of sprite (progressSprite + 1) to progWide * currentPercent
- updateStage()
- end if
- updateStage()
- (statusChk = 5):
- currentPercent = bytesSoFar / float(bytesTotal)
- put "Downloaded" && integer(currentPercent * 100) & "% -" && bytesSoFar / 1000 & "K of" && bytesTotal / 1000 & "K" into member "puzzPicFile"
- if the width of sprite (progressSprite + 1) < (progWide * currentPercent) then
- set the width of sprite (progressSprite + 1) to progWide * currentPercent
- updateStage()
- end if
- updateStage()
- end case
- if statusChk >= 5 then
- currentPercent = bytesSoFar / float(bytesTotal)
- put "Downloaded" && integer(currentPercent * 100) & "% -" && bytesSoFar / 1000 & "K of" && bytesTotal / 1000 & "K" into member "puzzPicFile"
- if the width of sprite (progressSprite + 1) < (progWide * currentPercent) then
- set the width of sprite (progressSprite + 1) to progWide * currentPercent
- updateStage()
- end if
- updateStage()
- end if
- end if
- end
-